<?php
 if(isset($this->id))
 {
 	$data = $this->data;
 ?>
 	<script>
	var myCenter=new google.maps.LatLng(<?php echo $data['latlngx'];?>,<?php echo $data['latlngy'];?>);
	
	function initialize()
	{
	var mapProp = {
	  center:myCenter,
	  zoom:<?php echo $data['zoom'];?>,
	  mapTypeId:google.maps.MapTypeId.ROADMAP
	  };
	
	var map=new google.maps.Map(document.getElementById("maps-item-<?php echo $data['id'];?>"),mapProp);
	
	var marker=new google.maps.Marker({
	  position:myCenter,
	  });
	
	marker.setMap(map);
	
	var infowindow = new google.maps.InfoWindow({
		content:"<h3><?php echo $data['name'];?></h3><div>Địa chỉ: <?php echo $data['address'];?></div><div>Số điện thoại: <?php echo $data['phone'];?></div>"
	  });
	
	infowindow.open(map,marker);
	}
	
	google.maps.event.addDomListener(window, 'load', initialize);
</script>
 	<div id="map-item-<?php echo $data['id'];?>" style="width:500px;height:380px;">
 	</div>
 <?php 
 }
 ?>